package com.kaiwukj.android.ufamily.mvp.ui.page.account;

import com.kaiwukj.android.mcas.mvp.IModel;
import com.kaiwukj.android.mcas.mvp.IView;
import com.kaiwukj.android.ufamily.mvp.http.entity.base.ListResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.params.UserInfoParams;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.CommunityResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.LoginResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.UserResult;

import java.util.List;

import io.reactivex.Observable;

public interface AccountContract {

    interface View extends IView {
        void loginSuccess();

        void wechatBindMobild(String openId);
    }

    interface CommunityView extends IView {
        void onFetchNearCommunity(List<CommunityResult> results);
    }

    interface EditView extends IView {
    }

    interface Model extends IModel {

        Observable<Integer> updatePass(String newPass);

        Observable<Integer> sendVerifyCode(String mobile);

        Observable<LoginResult> loginByPass(String username, String password);

        Observable<LoginResult> loginByCode(String mobile, String code);

        Observable<LoginResult> loginByWechat(String openId, String mobile, String code);

        Observable<LoginResult> loginByFast(String token, String opToken, String operator);

        Observable<UserResult> getUserInfo();

        Observable<ListResp<CommunityResult>> fetchNearCommunity(double lat, double lon);

        Observable<ListResp<CommunityResult>> fetchCommunityByKeyword(String keyword);

        Observable<Integer> updateCommunity(int communityId);

        Observable<Integer> updateUserInfo(UserInfoParams params);

        Observable<String> getQNToken();
    }

}
